/* const proxy = require('http-proxy-middleware')

module.exports = function(app){
	app.use(
		proxy('/admin',{ //遇见/api1前缀的请求，就会触发该代理配置
			target:'http://172.16.108.195:8081', //请求转发给谁
			changeOrigin:true,//控制服务器收到的请求头中Host的值
			pathRewrite:{'^/admin':''} //重写请求路径(必须)
		})
	)
} */
const { createProxyMiddleware } =require('http-proxy-middleware');

module.exports = function (app){
    app.use('/admin',
    createProxyMiddleware({
        target:'http://172.16.108.195:8081', //请求转发给谁
		changeOrigin:true,//控制服务器收到的请求头中Host的值
		pathRewrite:{'^/admin':''} //重写请求路径(必须)
    }))
}
